﻿
    using Game.Facade.Files;
    using Game.Utils;
    using Game.Web.UI;
    using System;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.IO;


namespace Game.Web.Tools
{
    partial class FilesUpload : Page
    {
        protected StringBuilder builder = new StringBuilder();
        protected string clientPath = GameRequest.GetQueryString("path");
      //  protected HtmlForm fmUploadSecond;
        protected string inImgUrl = GameRequest.GetQueryString("inImgUrl");

        protected void Page_Load(object sender, EventArgs e)
        {










            if ((TextUtility.EmptyTrimOrNull(this.clientPath) || (this.clientPath == "/")) || !this.clientPath.StartsWith("/upload"))
            {
                this.clientPath ="/upload";
            }
            HttpFileManager manager = new HttpFileManager(base.Request.QueryString["act"]);
            this.builder.Append(manager.Value);
            if (this.builder.Length > 0)
            {
                this.SetUploadFilePath(this.builder.ToString().Replace("'", @"\'").Replace("\r\n", ""), manager.UploadFilePath);
            }
        }

        protected void SetUploadFilePath(string msg, string uploadPath)
        {
            this.Page.ClientScript.RegisterStartupScript(typeof(Page), "", string.Format("showInfo(\"{2}\");setUploadFilePath(\"{0}\",\"{1}\");", this.inImgUrl, uploadPath, msg), true);
        }
    }
}

